function Recipe.OnCreate.HuanChe_C(items, result, player)
    local ZhanChe = SandboxVars.TS_Vehicle1
    if getWorld():getGameMode() ~= "Multiplayer" then
    for i=0,items:size() - 1 do
        local item = items:get(i)
        if item:getType() == "TS_Vehicle_card" then
            if not player:isOutside() or player:getZ() > 0 then
                player:Say(getText("IGUI_TS_failed"))
                player:getInventory():AddItem("TS_Vehicle_card")
            else
                local randomdir = {IsoDirections.E,IsoDirections.S,IsoDirections.W,IsoDirections.N}
                local qichebianhao = addVehicleDebug(ZhanChe,randomdir[ZombRand(4) + 1],-1,getSquare(player:getX(), player:getY(),player:getZ()))
                qichebianhao:repair()
                if qichebianhao:getCurrentKey() ~= nil then player:getInventory():AddItem(qichebianhao:getCurrentKey()) else player:getInventory():AddItem(qichebianhao:createVehicleKey()) end
                player:Say(getText("IGUI_TS_successed"))
            end
        end
    end
    else
        for i=1,items:size() do
            local item= items:get(i-1):getType()
            if item == "TS_Vehicle_card"then
                if not player:isOutside() or player:getZ() > 0 then
                    player:Say(getText("IGUI_TS_failed"))
                    player:getInventory():AddItem("TS_Vehicle_card")
                else
                    --if isClient() then
                        local command = string.format("/addvehicle %s", ZhanChe)
                        SendCommandToServer(command)
                    --else
                        --addVehicle(ZhanChe)
                    --end
                    player:Say(getText("IGUI_TS_successed"))
                end
            end
        end
    end
end

function Recipe.OnCreate.HuanChe_C2(items, result, player)
    local ZhanChe = SandboxVars.TS_Vehicle2
    if getWorld():getGameMode() ~= "Multiplayer" then
    for i=0,items:size() - 1 do
        local item = items:get(i)
        if item:getType() == "TS_Vehicle_card2" then
            if not player:isOutside() or player:getZ() > 0 then
                player:Say(getText("IGUI_TS_failed"))
                player:getInventory():AddItem("TS_Vehicle_card2")
            else
                local randomdir = {IsoDirections.E,IsoDirections.S,IsoDirections.W,IsoDirections.N}
                local qichebianhao = addVehicleDebug(ZhanChe,randomdir[ZombRand(4) + 1],-1,getSquare(player:getX(), player:getY(),player:getZ()))
                qichebianhao:repair()
                if qichebianhao:getCurrentKey() ~= nil then player:getInventory():AddItem(qichebianhao:getCurrentKey()) else player:getInventory():AddItem(qichebianhao:createVehicleKey()) end
                player:Say(getText("IGUI_TS_successed"))
            end
        end
    end
    else
        for i=1,items:size() do
            local item= items:get(i-1):getType()
            if item == "TS_Vehicle_card2"then
                if not player:isOutside() or player:getZ() > 0 then
                    player:Say(getText("IGUI_TS_failed"))
                    player:getInventory():AddItem("TS_Vehicle_card2")
                else
                    --if isClient() then
                        local command = string.format("/addvehicle %s", ZhanChe)
                        SendCommandToServer(command)
                    --else
                        --addVehicle(ZhanChe)
                    --end
                    player:Say(getText("IGUI_TS_successed"))
                end
            end
        end
    end
end

function Recipe.OnCreate.HuanChe_C3(items, result, player)
    local ZhanChe = SandboxVars.TS_Vehicle3
    if getWorld():getGameMode() ~= "Multiplayer" then
    for i=0,items:size() - 1 do
        local item = items:get(i)
        if item:getType() == "TS_Vehicle_card3" then
            if not player:isOutside() or player:getZ() > 0 then
                player:Say(getText("IGUI_TS_failed"))
                player:getInventory():AddItem("TS_Vehicle_card3")
            else
                local randomdir = {IsoDirections.E,IsoDirections.S,IsoDirections.W,IsoDirections.N}
                local qichebianhao = addVehicleDebug(ZhanChe,randomdir[ZombRand(4) + 1],-1,getSquare(player:getX(), player:getY(),player:getZ()))
                qichebianhao:repair()
                if qichebianhao:getCurrentKey() ~= nil then player:getInventory():AddItem(qichebianhao:getCurrentKey()) else player:getInventory():AddItem(qichebianhao:createVehicleKey()) end
                player:Say(getText("IGUI_TS_successed"))
            end
        end
    end
    else
        for i=1,items:size() do
            local item= items:get(i-1):getType()
            if item == "TS_Vehicle_card3"then
                if not player:isOutside() or player:getZ() > 0 then
                    player:Say(getText("IGUI_TS_failed"))
                    player:getInventory():AddItem("TS_Vehicle_card3")
                else
                    --if isClient() then
                        local command = string.format("/addvehicle %s", ZhanChe)
                        SendCommandToServer(command)
                    --else
                        --addVehicle(ZhanChe)
                    --end
                    player:Say(getText("IGUI_TS_successed"))
                end
            end
        end
    end
end